package com.cg.client;

import com.cg.client.impl.AppClientImpl;
import com.cg.dto.*;
import com.cg.entity.*;
import com.cg.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

@FeignClient(name = "app-provider",fallback = AppClientImpl.class)
public interface AppClient {

    /**
     * 获取注册需要的手机验证码
     */
    @PostMapping("/patientUser/getCode")
    public Result getCode(@RequestBody PhoneDto phoneDto);


    /**
     * 注册用户
     */
    @PostMapping("/patientUser/createPatientUser")
    public Result createPatientUser(@RequestBody RegisterPatientUserDto registerPatientUserDto);

    /**
     * 根据type_code查询所有类型
     */
    @GetMapping("/dictionary/queryDictionaryByTypeCode")
    public Result<List<Dictionary>> queryDictionaryByTypeCode(@RequestParam("typeCode") String typeCode);


    /**
     * 加载所有国家
     */
    @GetMapping("/country/queryCountryList")
    public Result<List<Country>> queryCountryList();


    /**
     * 查询所有民族
     */
    @GetMapping("/nation/queryNationList")
    public Result<List<Nation>> queryNationList();


    /**
     * 查询省
     */
    @GetMapping("/area/queryProvince")
    public Result<List<Area>> queryShen();

    /**
     * 查询市
     */
    @GetMapping("/area/queryCity")
    public Result<List<Area>> queryShi(@RequestParam("areaId") Integer areaId);

    /**
     * 查询区
     */
    @GetMapping("/area/queryArea")
    public Result<List<Area>> queryQu(@RequestParam("areaId") Integer areaId);

    /**
     * 省市区级联，查询省市区
     */
    @GetMapping("/area/getAreas")
    public Result<List<AreaListVo>> getAreas();


    /**
     * 获取登录的手机验证码
     */
    @PostMapping("/patientUser/getLoginCode")
    public Result getLoginCode(@RequestParam("phone") String phone);


    /**
     * 就诊人管理列表
     */
    @GetMapping("/patient/patientListByPatientUserId")
    public Result<List<PatientListVo>> patientListByPhone(@RequestParam("patientUserId") Integer patientUserId)throws ParseException ;


    /**
     * 患者登录
     */
    @PostMapping("/patientUser/loginPatientUser")
    public Result<LoginPatientUserVo> loginPatientUser(@RequestBody LoginPatientUserDto loginPatientUserDto);


    /**
     * 修改密码
     */
    @PostMapping("/patientUser/updatePassword")
    public Result updatePassword(@RequestBody UpdatePasswordDto updatePasswordDto);


    /**
     * 查询就诊人详情
     */
    @GetMapping("/patient/queryPatientByCardNum")
    public Result<PatientVo> queryPatientByCardNum(@RequestParam("cardNum") String cardNum);

    /**
     * 添加就诊人
     */
    @PostMapping("/patient/createPatient")
    public Result createPatient(@RequestBody Patient patient);


    /**
     * 加载所有院区
     */
    @GetMapping("/branch/queryBranchList")
    public Result<List<Branch>> queryBranchList();


    /**
     * 根据院区id查询科室
     */
    @GetMapping("/department/queryDepartmentByBranchId")
    public Result<List<Department>> queryDepartmentByBranchId(@RequestParam("branchId") Integer branchId);


    /**
     * 根据科室id查询对应的科别信息
     */
    @GetMapping("/divide/queryDivideByDepartmentId")
    public Result<List<Divide>> queryDivideByDepartmentId(@RequestParam("departmentId") Integer departmentId);


    /**
     * 根据token获取默认的就诊人信息
     */
    @PostMapping("/patient/getPatientByToken")
    public Result<Patient> getPatientByToken(@RequestParam("userId") Integer userId);


    /**
     * 授权
     */
    @PostMapping("/info/addInfo")
    public Result addInfo(@RequestParam("cardNum") String cardNum);


    /**
     * 查询轮播图列表
     */
    @GetMapping("/banner/queryBannerList")
    public Result<List<Banner>> queryBannerList();


    /**
     * 查询全部授权信息
     */
    @GetMapping("/info/queryInfoList")
    public Result<List<Info>> queryInfoList();


    /**
     * 根据id获取轮播图详情
     */
    @GetMapping("/banner/queryBannerByBannerId")
    public Result<Banner> queryBannerByBannerId(@RequestParam("bannerId") Integer bannerId);


    /**
     * 根据登录用户的ID查询就诊人数量
     */
    @GetMapping("/patient/queryCountByPatientUserId")
    public Result queryCountByPatientUserId(@RequestParam("patientUserId") Integer patientUserId);


    /**
     * 预约-选择科室
     */
    @PostMapping("/arrange/queryDateList")
    public Result<DateListVo> queryDateList(@RequestBody DateDto dateDto) throws ParseException;


    /**
     * 根据divideId和时间查询医生信息
     */
    @PostMapping("/arrange/queryArrangeDoctor")
    public Result<List<ArrangeDoctorVo>> queryArrangeDoctor(@RequestBody DateDto dateDto);


    /**
     * 根据科室名称模糊查询科室列表
     */
    @GetMapping("/department/queryDepartmentByDepartmentName")
    public Result<List<Department>> queryDepartmentByDepartmentName(@RequestParam("departmentName") String departmentName);


    /**
     * 根据科室id查询科室详情
     */
    @GetMapping("/department/queryDepartmentInfo")
    public Result<DepartmentInfoVo> queryDepartmentInfo(@RequestParam("departmentId") Integer departmentId);


    /**
     * 根据医生姓名模糊查询医生列表
     */
    @GetMapping("/doctor/queryDoctorList")
    public Result<List<DoctorListVo>> queryDoctorList(@RequestParam("doctorName") String doctorName);


    /**
     * 根据医生id查询医生详情
     */
    @GetMapping("/doctor/queryDoctorByDoctorId")
    public Result<DoctorListVo> queryDoctorByDoctorId(@RequestParam("doctorId") Integer doctorId);


    /**
     * 查询全部数据字典类型
     */
    @GetMapping("/dictionaryType/queryTypeCodeAll")
    public Result<List<DictionaryType>> queryTypeCodeAll();


    /**
     * 生成条形码
     */
    @GetMapping("/patient/barCode")
    public Result<String> barCode(@RequestParam("cardNum") String cardNum);

    /**
     * 生成二维码
     */
    @GetMapping("/patient/code")
    public Result<String> code(@RequestParam("cardNum") String cardNum);


    /**
     * 根据授权名称查询授权信息
     */
    @GetMapping("/info/queryInfo")
    public Result<Info> queryInfo(@RequestParam("infoName") String infoName);


    /**
     * 患者预约
     */
    @PostMapping("/order/createOrder")
    public Result createOrder(@RequestBody OrderDto orderDto);


    /**
     * 查询预约成功通知列表
     */
    @PostMapping("/order/orderList")
    public Result<Map<String,Object>> orderListByPatientId(@RequestBody OrderListPageDto orderListPageDto);


    /**
     * 根据orderNum查询详情
     */
    @GetMapping("/order/queryOrderDetailByOrderNum")
    public Result<OrderDetailVo> queryOrderDetailByOrderNum(@RequestParam("orderNum") String orderNum);


    /**
     * 查询菜单类型查询菜单集合
     */
    @GetMapping("/appSource/queryAppSource")
    public Result<List<AppSource>> queryAppSource(@RequestParam("sourceType") Integer sourceType);


    /**
     * 健康资讯信息展示
     */
    @PostMapping("/healthInfo/queryHealthList")
    public Result<List<HealthInfoVo>> queryHealthList();

    /**
     * 根据标题模糊查询资讯
     */
    @PostMapping("/healthInfo/queryHealthListByTitle")
    public Result<Map<String,Object>> queryHealthListByTitle(@RequestBody HealthInfoPageDto healthInfoPageDto);
}
